﻿@model COP4710.Models.DispatchModel
@using COP4710.Extensions;
@using COP4710.Controllers;
@{
    ViewBag.Title = "New Dispatch";
    ViewBag.PageTitle = ViewBag.Title;
}
@using (Html.BeginForm())
{
    @Html.ValidationSummary()

    <div id="GeneralInfo" class="Section" linktext="General Info">
        <div class="Header">
            General Information
        </div>
        <div class="Field">
            <div class="Label">
                Date
            </div>
            <div class="Input">
                @Model.CreateDate.ToString("hh:mm tt MM/dd/yyyy")
                @Html.HiddenFor(m => m.FormID)
            </div>
        </div>
        <div class="Field">
            <div class="Label"> 
                County
            </div>
            <div class="Input">
                @Html.DropDownListFor(x => x.County, new SelectList(Enum.GetValues(typeof(COP4710.Models.Enumerations.County))))
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                Unit #
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.Unit)
                @Html.ValidationMessageFor(m => m.Unit, "Oh No", new { @style = "Display:none;" })
            </div>
        </div>
    </div>
    <div id="ComplainantInfo" class="Section" linktext="Complainant Info">
        <div class="Header">
            Complainant Information
        </div>
        <div class="Field">
            <div class="Label">
                Age
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.InitialCondition.Age)@Html.DropDownListFor(x => x.InitialCondition.AgeType, new SelectList(Enum.GetValues(typeof(COP4710.Models.Enumerations.AgeType))))
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                Sex
            </div>
            <div class="Input">
                @Html.DropDownListFor(x => x.InitialCondition.Gender, new SelectList(Enum.GetValues(typeof(COP4710.Models.Enumerations.Gender))))
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                A&O X
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.InitialCondition.A_OX, new { @class = "textbox" });
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                Category
            </div>
            <div class="Input">
                @Html.DropDownListFor(x => x.InitialCondition.Category, new SelectList(Enum.GetValues(typeof(COP4710.Models.Enumerations.Category))))
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                Chief Complaint
            </div>
            <div class="Input">
                @Html.TextAreaFor(m => m.InitialCondition.ChiefComplaint, new { @class = "textbox" })
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                Blood Pressure
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.InitialCondition.BP1.Systolic, new { @class = "BP" })
                /
                @Html.TextBoxFor(m => m.InitialCondition.BP1.Diastolic, new { @class = "BP" })
            </div>
            <span class="Seperator">|</span>
            <div class="Input">
                @Html.TextBoxFor(m => m.InitialCondition.BP2.Systolic, new { @class = "BP" })
                /
                @Html.TextBoxFor(m => m.InitialCondition.BP2.Diastolic, new { @class = "BP" })
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                Pulse
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.InitialCondition.Pulse1, new { @class = "textbox short" })
                <span class="Seperator">|</span>
                @Html.TextBoxFor(m => m.InitialCondition.Pulse2, new { @class = "textbox short" })
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                Respirations
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.InitialCondition.Resp1, new { @class = "textbox short" })
                <span class="Seperator">|</span>
                @Html.TextBoxFor(m => m.InitialCondition.Resp2, new { @class = "textbox short" })
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                O2 Saturation
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.InitialCondition.O2Sat, new { @class = "textbox short" })%
                <span class="Seperator">|</span>
                @Html.TextBoxFor(m => m.InitialCondition.O2Sat2, new { @class = "textbox short" })%
            </div>
        </div>
    </div>
    <div id="CrashInfo" class="Section" linktext="Crash Info">
        <div class="Header">
            Crash Information
        </div>
        <div class="Field">
            <div class="Label">
                Driver
            </div>
            <div class="Input">
                @Html.DropDownListFor(x => x.CrashInformation.DriverRestrained, new SelectList(Enum.GetNames(typeof(COP4710.Models.Enumerations.DriverRestraintLevel))))
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                Passeneger
            </div>
            <div class="Input">
                @Html.DropDownListFor(x => x.CrashInformation.PassengerRestrained, new SelectList(Enum.GetValues(typeof(COP4710.Models.Enumerations.PassengerRestraintLevel))))
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                Speed
            </div>
            <div class="Input">
                <input class="textbox" />
            </div>
        </div>
        <div class="Field" style="">
            <div class="Label">
                Condition
            </div>
            <div class="Input">
                <div class="Checklist" style="width: 400px">
                    <table>
                        <tr>
                            <td class="selectable">
                                @Html.CheckBoxFor(m => m.CrashInformation.Ejected) @Html.LabelFor(m => m.CrashInformation.Ejected)
                            </td>
                            <td class="selectable">
                                @Html.CheckBoxFor(m => m.CrashInformation.Entrapped) @Html.LabelFor(m => m.CrashInformation.Entrapped)
                            </td>
                        </tr>
                        <tr>
                            <td class="selectable">
                                @Html.CheckBoxFor(m => m.CrashInformation.Rollover) @Html.LabelFor(m => m.CrashInformation.Rollover)
                            </td>
                            <td class="selectable">
                                @Html.CheckBoxFor(m => m.CrashInformation.HasHelmet) @Html.LabelFor(m => m.CrashInformation.HasHelmet)
                            </td>
                        </tr>
                        <tr>
                            <td class="selectable">
                                @Html.CheckBoxFor(m => m.CrashInformation.AirbagDeployed) @Html.LabelFor(m => m.CrashInformation.AirbagDeployed)
                            </td>
                            <td class="selectable">
                                @Html.CheckBoxFor(m => m.CrashInformation.isPackaged) @Html.LabelFor(m => m.CrashInformation.isPackaged)
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div id="Alerts" class="Section" linktext="Alerts">
        <div class="Header">
            Alerts
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.Alerts.TraumaAlert)
            </div>
            <div class="Input">
                @Html.CheckBoxFor(m => m.Alerts.TraumaAlert)
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.Alerts.StrokeAlert)
            </div>
            <div class="Input">
                @Html.CheckBoxFor(m => m.Alerts.StrokeAlert)
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.Alerts.onSet)
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.Alerts.onSet);
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.Alerts.STEMI)
            </div>
            <div class="Input">
                @Html.CheckBoxFor(m => m.Alerts.STEMI)
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.Alerts.TIBR)
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.Alerts.TIBR)
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.Alerts.History)
            </div>
            <div class="Input">
                @Html.DropDownListFor(x => x.Alerts.History, new SelectList(Enum.GetValues(typeof(COP4710.Models.Enumerations.History))))
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.Alerts.Treatment)
            </div>
            <div class="Input">
                @Html.DropDownListFor(x => x.Alerts.Treatment, new SelectList(Enum.GetValues(typeof(COP4710.Models.Enumerations.Treatment))))
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.Alerts.DISP)
            </div>
            <div class="Input">
                @Html.DropDownListFor(m => m.Alerts.DISP, new UserController().AjaxListUsersByName())
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.Alerts.Notified)
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.Alerts.Notified)
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.Alerts.ETA)
            </div>
            <div class="Input">
                @Html.DropDownListFor(m => m.Alerts.ETA, new DispatchController().ListETA())
            </div>
        </div>
    </div>
    <div id="MedicalDetail" class="Section" linktext="Medical Detail">
        <div class="Header">
            Medical Details
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.MedicalDetail.Detail)
            </div>
            <div class="Input">
                @Html.TextAreaFor(m => m.MedicalDetail.Detail, new { @class = "textbox" })
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.MedicalDetail.Level)
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.MedicalDetail.Level)
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.MedicalDetail.TC_ER__PEDS)
            </div>
            <div class="Input">
                @Html.DropDownListFor(x => x.MedicalDetail.TC_ER__PEDS, new SelectList(Enum.GetValues(typeof(COP4710.Models.Enumerations.DispatchDestination))))
            </div>
        </div>
    </div>
    <div id="MedicalControl" class="Section" linktext="Medical Control">
        <div class="Header">
            Medical Controls
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.MedicalControl.Rescue)
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.MedicalControl.Rescue)
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.MedicalControl.Meds)
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.MedicalControl.Meds)
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.MedicalControl.DrsSignature)
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.MedicalControl.DrsSignature)
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.MedicalControl.DEANumber)
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.MedicalControl.DEANumber)
            </div>
        </div>
        <div class="Field">
            <div class="Label">
                @Html.LabelFor(m => m.MedicalControl.NARC)
            </div>
            <div class="Input">
                @Html.TextBoxFor(m => m.MedicalControl.NARC)
                @{ 
           Html.ValidateFor(m => m.MedicalControl.NARC);
                }
            </div>
        </div>
    </div>
}